class BlogPostsController < ApplicationController 

  def index
     @blog_posts = BlogPost.all
   end
 

 def show
     @blog_post = BlogPost.find(params[:id])
   end
 

 def new
     @blog_post = BlogPost.new
   end
 

 def create
     @blog_post = BlogPost.new(params[:blog_post])
     @blog_post.save
     redirect_to @blog_post
   end
 

 def destroy
     @blog_post = BlogPost.find(params[:id])
     @blog_post.destroy
     redirect_to blog_posts_url
   end
 end

